package com.zjmcollege.hotpot.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief
 * @email 122162005@qq.com
 * @date 2019-11-11 15:21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "comment", indexes = {@Index(columnList = "author_id"), @Index(columnList = "relation_id")})
public class Comment {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 对应文章，评论的的 id
     */
    @Column(name = "relation_id")
    private Long relationId;
    /**
     * 评论内容
     */
    @Column(name = "content", length = 600)
    private String content;
    /**
     * 发表评论的作者
     */
    @Column(length = 60)
    private String author;
    @Column(name = "author_id")
    private Long authorId;
    @Column(name = "created_time")
    private Timestamp createdTime;
}
